<script setup lang="ts">
import HeaderNav from './components/HeaderNav.vue';

const handleNavClick = (item: { label: string; path: string }) => {
  console.log('导航点击:', item);
};

const handleUserMenuClick = (action: string) => {
  console.log('用户菜单点击:', action);
};
</script>

<template>
  <div class="app-container">
    <HeaderNav
      :title="'我的应用'"
      :logo="'/logo.svg'"
      :nav-items="[
        { label: '首页', path: '/' },
        { label: '关于', path: '/about' },
        { label: '服务', path: '/services' },
        { label: '联系', path: '/contact' }
      ]"
      :user-name="'张三'"
      @nav-click="handleNavClick"
      @user-menu-click="handleUserMenuClick"
    />
    <main class="main-content">
      <h1>You did it!</h1>
      <p>
        Visit <a href="https://vuejs.org/" target="_blank" rel="noopener">vuejs.org</a> to read the
        documentation
      </p>
    </main>
  </div>
</template>

<style scoped>
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
</style>
